﻿using System;

namespace QSWcfServiceLibrary
{
    
    public class PersonService : IPersonService
    {
        readonly Action<Person> savePersonDelegate;
        readonly Action<string> findDelegate;
        public PersonService()
        {
            savePersonDelegate = SavePerson;
            findDelegate = Find;
        }

        public void SavePerson(Person person)
        {
            WcfParameterValidationManager.ThrowException(this, savePersonDelegate, person);
        }

        public void Find(string name)
        {
            WcfParameterValidationManager.ThrowException(this, findDelegate, name);
        }
    }
}